package com.yun.blog.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

/**
 * title        : User
 * projectName  : dantouBlog-back
 * description  : 用户
 * author       : simple
 * date         : 2022/11/23下午8:07
 */

/*CREATE TABLE `blog_user`
(
    `user_id`         int UNSIGNED PRIMARY KEY AUTO_INCREMENT COMMENT '管理员id',
    `user_nick_name`  varchar(12)        NOT NULL DEFAULT '' COMMENT '管理员名称',
    `user_username`   varchar(12) UNIQUE NOT NULL DEFAULT '' COMMENT '管理员账号',
    `user_password`   varchar(32)        NOT NULL DEFAULT '' COMMENT '登录密码',
    `email`           char(20) COMMENT '邮箱地址',
    `signature`       varchar(255)                DEFAULT '' COMMENT '个性签名',
    `head_img`        varchar(255)                DEFAULT '' COMMENT '头像url',
    `is_superuser`    boolean            NOT NULL DEFAULT FALSE COMMENT '是否是超级用户',
    `is_lock`         boolean            NOT NULL DEFAULT FALSE COMMENT '锁定',
    `last_login_time` datetime           NOT NULL DEFAULT CURRENT_TIMESTAMP
);*/
@Data
@TableName("blog_user")
public class User {

    @TableId(type = IdType.AUTO)
    private Integer userId;
    private String userNickName;
    private String userUsername;
    private String userPassword;
    private String email;
    private String signature;
    private String headImg;
    private Boolean isSuperuser;
    private Boolean isLock;
    private String openId;
    private String accessToken;
    private String refreshToken;

    @JsonFormat(pattern = "yyyy年MM月dd日 hh:mm:ss", timezone = "GMT+8")
    private Date expiresIn;
    @JsonFormat(pattern = "yyyy年MM月dd日 hh:mm:ss", timezone = "GMT+8")
    private Date refreshExpiresIn;

    @JsonFormat(pattern = "yyyy年MM月dd日 hh:mm:ss", timezone = "GMT+8")
    private Date registerTime;
    @JsonFormat(pattern = "yyyy年MM月dd日 hh:mm:ss", timezone = "GMT+8")
    private Date lastLoginTime;
}
